//
// GPSMapEdit
// (c) Konstantin Galichsky (kg@geopainting.com), 2005
//
// Helpers for OziExplorer-specific formats.
//

# include "StdAfx.h"
# include "OziHelpers.h"
# include "ParseHelpers.h"

	// Find end of field.
const char * OziFindNextField (const char * _pBegin, const char * _pEnd) {
	for (const char * p = _pBegin; p < _pEnd; ++ p)
		if (* p == ',')
			return p + 1 < _pEnd ? p + 1 : _pEnd;

	return _pEnd;
}

void OziParseString (const char * _strField, const char * _strNextField, string_t & _str) {
	_str.assign (_strField, GetLineLen (_strField, _strNextField - 1));

	// Replace 209 with comma.
	for (size_t c = 0; c < _str.size (); ++ c)
		if (_str [c] == (char) 209)
			_str [c] = ',';
}
